package com.lobaby.tools.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @author Administrator
 *         Created by Administrator on 2019/11/26 0026.
 */
@Configuration
public class FilePathRegistryConfig extends WebMvcConfigurerAdapter {
    @Value("${save.path.uploadsFile}")
    private String uploadsFile;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/uploadsFile/**").addResourceLocations(uploadsFile);

        super.addResourceHandlers(registry);
    }
}
